package com.tonyodev.fetchapp.fetch2core;

import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;

import com.tonyodev.fetch2core.FetchExtensions;

import org.junit.Test;

import static org.junit.Assert.*;

public class FetchExtensionsTest {

    @Test
    public void isOnWiFi() {
        boolean isOnWif = FetchExtensions.isOnWiFi(AbilityDelegatorRegistry.getAbilityDelegator().getAppContext());
        assertTrue(isOnWif);
    }

    @Test
    public void isOnMeteredConnection() {
        boolean isOnMeteredConnection = FetchExtensions.isOnMeteredConnection(AbilityDelegatorRegistry.getAbilityDelegator().getAppContext());
        assertFalse(isOnMeteredConnection);
    }

    @Test
    public void isNetworkAvailable() {
        boolean isNetworkAvailable = FetchExtensions.isNetworkAvailable(AbilityDelegatorRegistry.getAbilityDelegator().getAppContext());
        assertTrue(isNetworkAvailable);
    }
}